.class Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;
.super Ljava/lang/Object;
.source "DlgContactPicker.java"

# interfaces
.implements Landroid/view/View$OnKeyListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/DlgContactPicker;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ListKeyListener"
.end annotation


# instance fields
.field final synthetic this$0:Lcom/glympse/android/glympse/DlgContactPicker;


# direct methods
.method private constructor <init>(Lcom/glympse/android/glympse/DlgContactPicker;)V
    .locals 0
    .parameter

    .prologue
    .line 63
    iput-object p1, p0, Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;->this$0:Lcom/glympse/android/glympse/DlgContactPicker;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/glympse/android/glympse/DlgContactPicker;Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 63
    invoke-direct {p0, p1}, Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;-><init>(Lcom/glympse/android/glympse/DlgContactPicker;)V

    return-void
.end method


# virtual methods
.method public onKey(Landroid/view/View;ILandroid/view/KeyEvent;)Z
    .locals 12
    .parameter "v"
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 69
    invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I

    move-result v10

    if-eqz v10, :cond_0

    .line 71
    const/4 v10, 0x0

    .line 168
    :goto_0
    return v10

    .line 75
    :cond_0
    iget-object v10, p0, Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;->this$0:Lcom/glympse/android/glympse/DlgContactPicker;

    invoke-static {v10}, Lcom/glympse/android/glympse/DlgContactPicker;->access$0(Lcom/glympse/android/glympse/DlgContactPicker;)Landroid/widget/ExpandableListView;

    move-result-object v10

    invoke-virtual {v10}, Landroid/widget/ExpandableListView;->getExpandableListAdapter()Landroid/widget/ExpandableListAdapter;

    move-result-object v8

    .line 76
    .local v8, oExpandableListAdapter:Landroid/widget/ExpandableListAdapter;
    invoke-interface {v8}, Landroid/widget/ExpandableListAdapter;->getGroupCount()I

    move-result v4

    .line 79
    .local v4, nCount:I
    if-gtz v4, :cond_1

    .line 81
    const/4 v10, 0x0

    goto :goto_0

    .line 85
    :cond_1
    invoke-virtual {p3}, Landroid/view/KeyEvent;->getUnicodeChar()I

    move-result v3

    .line 86
    .local v3, nChar:I
    if-lez v3, :cond_2

    const/16 v10, 0x20

    if-ne v3, v10, :cond_3

    .line 88
    :cond_2
    const/4 v10, 0x0

    goto :goto_0

    .line 92
    :cond_3
    invoke-static {v3}, Ljava/lang/Character;->toLowerCase(I)I

    move-result v7

    .line 94
    .local v7, nLower:I
    const/4 v5, -0x1

    .line 97
    .local v5, nGroup:I
    iget-object v10, p0, Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;->this$0:Lcom/glympse/android/glympse/DlgContactPicker;

    invoke-static {v10}, Lcom/glympse/android/glympse/DlgContactPicker;->access$0(Lcom/glympse/android/glympse/DlgContactPicker;)Landroid/widget/ExpandableListView;

    move-result-object v10

    invoke-virtual {v10}, Landroid/widget/ExpandableListView;->getSelectedPosition()J

    move-result-wide v1

    .line 98
    .local v1, lPacked:J
    const-wide v10, 0xffffffffL

    cmp-long v10, v1, v10

    if-eqz v10, :cond_5

    .line 101
    invoke-static {v1, v2}, Landroid/widget/ExpandableListView;->getPackedPositionGroup(J)I

    move-result v5

    .line 104
    add-int/lit8 v5, v5, 0x1

    if-ge v5, v4, :cond_8

    .line 107
    invoke-interface {v8, v5}, Landroid/widget/ExpandableListAdapter;->getGroup(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;

    .line 108
    .local v9, oPerson:Lcom/glympse/android/glympse/DlgContactPicker$Person;
    if-eqz v9, :cond_4

    iget v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_nImage:I

    if-nez v10, :cond_4

    iget-object v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_strPerson:Ljava/lang/String;

    invoke-static {v10}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v10

    if-nez v10, :cond_4

    .line 109
    iget-object v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_strPerson:Ljava/lang/String;

    const/4 v11, 0x0

    invoke-virtual {v10, v11}, Ljava/lang/String;->charAt(I)C

    move-result v10

    invoke-static {v10}, Ljava/lang/Character;->toLowerCase(C)C

    move-result v10

    if-eq v10, v7, :cond_5

    .line 111
    :cond_4
    const/4 v5, -0x1

    .line 121
    .end local v9           #oPerson:Lcom/glympse/android/glympse/DlgContactPicker$Person;
    :cond_5
    :goto_1
    if-gez v5, :cond_7

    .line 123
    const/4 v6, 0x0

    .line 127
    .local v6, nLastValidGroup:I
    const/4 v5, 0x0

    :goto_2
    if-lt v5, v4, :cond_9

    .line 155
    :cond_6
    :goto_3
    if-lt v5, v4, :cond_7

    .line 157
    const/4 v10, 0x1

    sub-int v5, v4, v10

    .line 162
    .end local v6           #nLastValidGroup:I
    :cond_7
    if-ltz v5, :cond_c

    .line 164
    iget-object v10, p0, Lcom/glympse/android/glympse/DlgContactPicker$ListKeyListener;->this$0:Lcom/glympse/android/glympse/DlgContactPicker;

    invoke-static {v10}, Lcom/glympse/android/glympse/DlgContactPicker;->access$0(Lcom/glympse/android/glympse/DlgContactPicker;)Landroid/widget/ExpandableListView;

    move-result-object v10

    invoke-virtual {v10, v5}, Landroid/widget/ExpandableListView;->setSelectedGroup(I)V

    .line 165
    const/4 v10, 0x1

    goto :goto_0

    .line 116
    :cond_8
    const/4 v5, -0x1

    goto :goto_1

    .line 130
    .restart local v6       #nLastValidGroup:I
    :cond_9
    invoke-interface {v8, v5}, Landroid/widget/ExpandableListAdapter;->getGroup(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;

    .line 131
    .restart local v9       #oPerson:Lcom/glympse/android/glympse/DlgContactPicker$Person;
    if-eqz v9, :cond_b

    iget v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_nImage:I

    if-nez v10, :cond_b

    iget-object v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_strPerson:Ljava/lang/String;

    invoke-static {v10}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v10

    if-nez v10, :cond_b

    .line 134
    iget-object v10, v9, Lcom/glympse/android/glympse/DlgContactPicker$Person;->m_strPerson:Ljava/lang/String;

    const/4 v11, 0x0

    invoke-virtual {v10, v11}, Ljava/lang/String;->charAt(I)C

    move-result v10

    invoke-static {v10}, Ljava/lang/Character;->toLowerCase(C)C

    move-result v0

    .line 135
    .local v0, cCurrent:C
    if-eq v0, v7, :cond_6

    .line 144
    if-le v0, v7, :cond_a

    .line 146
    move v5, v6

    .line 147
    goto :goto_3

    .line 150
    :cond_a
    move v6, v5

    .line 127
    .end local v0           #cCurrent:C
    :cond_b
    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    .line 168
    .end local v6           #nLastValidGroup:I
    .end local v9           #oPerson:Lcom/glympse/android/glympse/DlgContactPicker$Person;
    :cond_c
    const/4 v10, 0x0

    goto/16 :goto_0
.end method
